package com.chun.exception;

import com.chun.pojo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(value = Exception.class)
    public Result handlerException(Exception e) {
        e.printStackTrace();
        System.out.println("异常信息：" + e.getMessage());
        return Result.error("服务器异常");
    }
}
